<template>
    
	<!-- 页头变色 -->
	<!-- <view :class="'fui-header '+themeDat[theme].head">
		<view class="title">工作台</view>
	</view> -->
	<view class="fui-content">
		<!-- 页头变色 -->
		<view :class="'fui-cell-group '+themeDat[theme].head" >
			<view class="m_head flex">
				<view class="fui-left flex">
					<image :src="userShop.logo!=''?(qiNiu+'/'+userShop.logo):''"></image>
					<view class="head_name">
						<view>{{userShop.merchname}}</view>
						<view>{{userShop.desc==''?'未设置商城简介':userShop.desc}}</view>
					</view>					
				</view>
				<navigator class="fui-right head_r" url="../set/set">
					<view class="iconfont icon-shezhi"></view>
				</navigator>
				<view class="theme">
					<view class="t-title" @click="zhuti">切换主题</view>
					<view class="t-list" v-if="show">
						<view class="t-item" @click="themeColor(0)">
							<view>主题一</view>														
						</view>
						<view class="t-item" @click="themeColor(1)">
							<view>主题二</view>															
						</view>
						
					</view>
				</view>				    
			</view>
		</view>
		<view class="fui-cell-group flex fui-menu" >
			<view class="fui-menu-item">
				<view>{{orderDay.today_count}}</view>
				<view>今日订单</view>
			</view>
			<view class="fui-menu-item">
				<view>{{orderDay.today_price}}</view>
				<view>今日成交</view>
			</view>
		</view>
		<view class="fui-cell-group">
			<view class="fui-cell">
				<view class="fui-cell-icon iconfont icon-wqdd"></view>
				<view class="fui-cell-text">订单管理</view>
				<navigator url="../order/order" class="fui-cell-remark">全部</navigator>
			</view>
			<view class="fui-block-group col-3">
				<view class="fui-block-child">
					<navigator class="fui-list-itemsm" url="../order/order">
						<!-- 图标变色 -->
						<view :class="'icon iconfont icon-icon-test '+themeDat[theme].type"></view>
						<view class="title">待发货</view>
						<view class="text"><!-- 图标变色 --><text :class="themeDat[theme].type">{{order.status1}}</text>单</view>
					</navigator>					
				</view>
				<view class="fui-block-child">
					<navigator class="fui-list-itemsm"  url="../order/order?state=2">
						<!-- 图标变色 -->
						<view :class="'icon iconfont icon-daifukuan '+themeDat[theme].type"></view>
						<view class="title">待付款</view>
						<view class="text"><!-- 图标变色 --><text :class="themeDat[theme].type">{{order.status0}}</text>笔</view>
					</navigator>
				</view>
				<view class="fui-block-child">
					<navigator class="fui-list-itemsm"  url="../order/order?type=wq">
						<!-- 图标变色 -->
						<view :class="'icon iconfont icon-wqdd '+themeDat[theme].type"></view>
						<view class="title">维权订单</view>
						<view class="text"><!-- 图标变色 --><text :class="themeDat[theme].type">{{order.status4}}</text>笔</view>
					</navigator>
				</view>
			</view>
		</view>
		<view class="fui-cell-group">
			<view class="fui-cell">
				<view class="fui-cell-icon iconfont icon-dianpushezhi"></view>
				<view class="fui-cell-text">商城管理</view>
			</view>
			<view class="fui-block-group col-3">
				<view class="fui-block-child">
					<navigator class="fui-list-itemsm" url="../goods/goods">
						<!-- 图标变色 -->
						<view :class="'icon iconfont icon-shangpinguanli '+themeDat[theme].type"></view>
						<view class="title">商品管理</view>
						<view class="text"><!-- 图标变色 --><text v-if="shop.goods_count" :class="themeDat[theme].type">{{shop.goods_count}}</text>个</view>
					</navigator>
				</view>
				<view class="fui-block-child">
					<navigator class="fui-list-itemsm" url="../apply/apply">
						<!-- 图标变色 -->
						<view :class="'icon iconfont icon-jiesuanguanli '+themeDat[theme].type"></view>
						<view class="title">结算管理</view>
						<view class="text"></view>
					</navigator>
				</view>
				<view class="fui-block-child">
					<navigator class="fui-list-itemsm" url="../statistics/statistics">
						<!-- 图标变色 -->
						<view :class="'icon iconfont icon-shujutongji '+themeDat[theme].type "></view>
						<view class="title">数据统计</view>
						<view class="text"></view>
					</navigator>
				</view>
				<view class="fui-block-child">
					<navigator class="fui-list-itemsm"  url="../set/set">
						<!-- 图标变色 -->
						<view :class="'icon iconfont icon-dianpushezhi '+ themeDat[theme].type"></view>
						<view class="title">店铺设置</view>
						<view class="text"></view>
					</navigator>
				</view>
			</view>
		</view>
		<view class="fui-title center">更多设置请至PC端后台</view>
		<view class="bstatus_bar"></view>
		<footernav></footernav>
	</view>		
</template>

<script>
var t = getApp().globalData,
	e = t.requirejs('core'),
	i = t.requirejs('foxui'),
	a = t.requirejs('jquery');
	export default {
		data() {
			return {
				theme:0,
				show:false,
				themeDat:[
					{
						'type':'success',
						'head':'primarybg'
						
					},
					{
						'type':'warning',
						'head':'dangerbg'
					},
					
				],
				order:{
					
				},
				shop:{
					
				},
				orderDay:{
					
				},
				userShop:[],
				qiNiu:''
			}
		},
		onLoad(){
			this.userShop=t.getCache('user_shop')
			this.qiNiu=t.qiNiu
			this.init()
		},
		onShow() {
			let data=t.getCache('user_shop')
			if(data!='')
				this.userShop=data
				
		},
		methods: {
			init(){
				let self=this
				//商城管理 总数量
				e.get('merchmanage.get_shop', {}, function(t) {
					self.shop=t.result
				});
				
				//订单管理 价格
				e.get('merchmanage.get_today', {}, function(t) {
					self.orderDay=t.result
					
				});
				//订单管理 订单数量
				e.get('merchmanage.get_order', {}, function(t) {
					self.order=t.result
				});
	
				
			},
			//select 选择事件
			selectOne(options) {
				  this.selecValue = options
			 },
			themeColor(item){
				this.theme=item
				this.show=false
			},
			zhuti(){
				this.show=!this.show
			}
		}
	}
</script>

<style lang="scss">
@import '../../uni.scss';
page{
	margin-bottom: 40rpx;
}
.fui-cell-group{
	font-size: 28rpx;
	color: #666;	
	overflow: inherit;
}
.fui-cell-group.primarybg,.fui-cell-group.dangerbg{
	margin-top: 0;
}
// .fui-header{
// 	background: #428bca;
// }
// .fui-header .title{
// 	color: #fff;
// }
// .fui-content{
// 	margin-top: 88rpx;;
// }
.m_head{
	height: 240rpx;
	align-items: center;
	padding: 0 20rpx;
	color: #fff;
	position: relative;
}
.fui-left{
	width: 100vw;
}
.fui-right{
	flex-shrink: 0;
}
.fui-left image{
	border: 1px solid #fff;
	width: 100rpx;
	height: 100rpx;
	margin-right: 20rpx;
	border-radius: 50%;
}
.head_name{
	line-height: 60rpx;
}
.head_r{	
	position: relative;
	top: -50rpx;
}
.theme{
	position: absolute;
	right: 20rpx;
	top: 170rpx;
	z-index: 99;
}
.t-title{
	border: 1px solid #fff;
	padding: 10rpx;
	border-radius: 10rpx;
	font-size: 26rpx;
}
.t-list{
	background: rgba(0,0,0,.7);
	position: absolute;
	width: 180rpx;
	right: 0;
	top: 84rpx;
	text-align: center;
	line-height: 60rpx;
	padding: 0 10rpx;
	border-radius: 10rpx;
}
.t-list::after{
	content: "";
	width: 0;
	height: 0;
	border-left: 10rpx solid transparent;
	border-right: 10rpx solid transparent;
	border-bottom: 13rpx solid rgba(0,0,0,.7);
	position: absolute;
	top: -13rpx;
	right: 40rpx;
}
.t-item{
	border-bottom: 1px solid #fff;
}
.t-item:last-child{
	border-bottom: 0;
}
.fui-menu{
	padding: 30rpx 0;
}
.fui-menu-item{
	width: 50%;
	text-align: center;
}
.fui-menu-item:first-child{
	border-right: 1px solid #ececec;
}

.fui-block-child{
	box-sizing: border-box;
	padding: 0 20rpx;
	
	border-right: 1px solid #ececec;
	border-bottom: 1px solid #ececec;
}
.fui-block-group{
	margin: 0 0 20rpx 0;
}
.fui-block-group .fui-block-child:before{
	display: none;
}
.fui-block-group .fui-block-child:after{
	display: none;
}
.fui-list-itemsm{
	// box-shadow: 6rpx 0rpx 12rpx 5rpx #ecf5ff;
	// border-radius: 20rpx;
	
	padding: 20rpx 0;
}
.fui-block-group .fui-block-child .icon{
	padding-top:20rpx;
	height: 60rpx;
}
.text text{
	padding-right: 10rpx;
}

</style>
